home *** CD-ROM | disk | FTP | other *** search
/ Gold Medal Software 2 / Gold Medal Software Volume 2 (Gold Medal) (1994).iso / os2 / cenvi2.arj / CBPRINT.CMD < prev    next >
OS/2 REXX Batch file  |  1993-11-17  |  643b  |  20 lines

  1. EXTPROC CEnvi
  2. /********************************************************************
  3.  *** CBPrint.cmd - Print contents of the clipboard to the printer ***
  4.  ********************************************************************/
  5.  
  6. #include <ClipBrd.lib>
  7.  
  8. ClipText = GetClipboardData(CF_TEXT);
  9. if ( ClipText ) {
  10.    printf("Have clipboard text\n");
  11.    fp = fopen("\\DEV\\PRN","wt");
  12.    if ( fp ) {
  13.       fwrite(ClipText,strlen(ClipText),fp);
  14.       fclose(fp);
  15.       printf("Clipboard text has been sent to the printer.\n");
  16.    } else
  17.       printf("Error opening printer.\n");
  18. } else
  19.    printf("No text data in the clipboard.\n");
  20.